<?php
 session_start();
 include("include/session.php");
 include("include/common.php");
 include("include/db.php");
 
 $sqlCourses = mysql_query("SELECT number_classes FROM software_courses where batch_code = '".$_REQUEST['courses']."'");
 $resCourses = mysql_fetch_array($sqlCourses);
 $numberClasses = $resCourses["number_classes"];
				
 ?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title><?=TITLE_WEBSITE?></title>
<link href="css/c_energy.css" rel="stylesheet" type="text/css" />
<link href="css/logo.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="css/datepicker.css" type="text/css" />
<link rel="stylesheet" media="screen" type="text/css" href="css/layout.css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/datepicker.js"></script>
<script type="text/javascript" src="js/eye.js"></script>
<script type="text/javascript" src="js/utils.js"></script>
<script type="text/javascript">
</script>
<style type="text/css">
<!--
.style4 {
	font-size: 22px;
	font-weight: bold;
}
.style6 {color: #999999}
-->
</style>
</head>
<script>
function validation(){
	
	var message = '';
	
	
	if(document.getElementById("course_category").value == ""){
		message += 'Please enter course category\n';
	}
	if(document.getElementById("number_classes").value == ""){
		message += 'Please enter course classess\n';
	}
	
	if(message != ""){
		alert(message);
		return false;
	}
	
	
}
</script>
<body>

    <table width="990" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
        <td colspan="3" align="left" valign="top" ><? require("header.php");?></td>
</tr>
  <tr>
    <td align="center" >
	<table width="99%" cellspacing="0" cellpadding="0">
      <tr>
        <td colspan="3" align="center" valign="top">&nbsp;</td>
      </tr>
       <tr bgcolor="#FAFAFA">
        <td colspan="0" align="left" valign="top" >
		   <table width="96%" cellspacing="0" cellpadding="0">
		    <tr>
		      <td width="2%" align="left" valign="top" style="padding-left:15px" ><? require("left.php");?></td>
		      <td width="94%"  valign="top" style="padding-left:15px" >
			  <form name="signform" action="" method="post" enctype="multipart/form-data" id="signform" onsubmit="return validation();" >
			    <table id="signInTbl" width="719" cellspacing="0" cellpadding="0" style="border:solid #cccccc 1px">
                  <tr>
                    <td colspan="2" align="left" bgcolor="#373737" class="loc_search_found_term"  style="border-bottom:solid #cccccc 1px">&nbsp;Classess</td>
                  </tr>
                
                  <tr height="30">
                    <td width="249" align="left" style="padding-left:15px"> Course</td>
                    <td width="466" align="left">
                        <select id="courses" name="courses" onchange="window.location.href='courses_class.php?courses='+this.value" >
                        	<option value="" >Select</option>
                        	<?php
                       		 $sqlCourses = mysql_query("SELECT name,batch_code FROM software_courses");
                        	 while($resCourses = mysql_fetch_array($sqlCourses)){
								?>
                        	<option value="<?=$resCourses["batch_code"]?>" <?=$_REQUEST['courses'] == $resCourses ["batch_code"] ? 'selected=selected' : '' ?> ><?=$resCourses["batch_code"]?></option>
                        	<?php		
                        	}
                        	?>
                        </select>
                    </td>
                </tr> 
               
                <tr>
                	<td colspan="2" align="center">
                    	<table width="600" style="border:1px solid #000" >
                        	<tr style=" background:#000;color:#FFF; font-weight:bold">
                            <td style="color:#FFF" width="5%">&nbsp;</td>
                            	<td style="color:#FFF" width="30%">Class</td>
                                <td style="color:#FFF">Start Time</td>
                                <td style="color:#FFF">End Time</td>
                                <td></td>
                            </tr>
                            <?php
                            for($i=1;$i<=$numberClasses;$i++)
							{
								if($x%2) $bgColor = 'bgcolor = "#FFFFFF"'; else $bgColor = 'bgcolor = "#F0F0F0"';
										 $x++;
							?>
                            <tr <?=$bgColor?> height="35"  >
                            	 <td style="color:#FFF" width="5%">&nbsp;</td>
                                <td >Class<?=$i?></td>
                                <td > <input style="width:140px"  id="start_date<?=$i?>" name="start_date<?=$i?>" value="" type="text"    maxlength="25" /><img src="images/Calendar.gif" align="absmiddle" style="cursor:pointer;  margin-left:3px; margin-top:2px;" onclick="return showCalendar('start_date<?=$i?>', '%Y-%m-%d %H:%M', '24', true);" /></td>
                                <td> <input style="width:140px"  id="end_date<?=$i?>" name="end_date<?=$i?>" value="" type="text"    maxlength="25" /><img src="images/Calendar.gif" align="absmiddle" style="cursor:pointer;  margin-left:3px; margin-top:2px;" onclick="return showCalendar('end_date<?=$i?>', '%Y-%m-%d %H:%M', '24', true);" /></td>
                                <td></td>
                            </tr>
                            
                            <?php
							}
							?>
						</table>
                    </td>
                
                </tr>
                
                   <tr  height="30">
                    <td width="249"  style="padding-left:15px" colspan="2" align="center"><input class="cls_button" type="submit" id="submit" name="submit" value="Submit"  /> </td>
                  </tr>
                </table>
			    <ul class="site_nav_menu_buttons">
			      <li class="no_menu_li"><span><a href="courses.php">&nbsp;Back to Courses </a></span></li>
			      </ul>
			    <p>&nbsp;</p>
			  </form>			  </td>
            </tr>
	        </table></td>
        </tr>
      <tr bgcolor="#FAFAFA">
        <td width="800" align="center" valign="top">&nbsp;</td>
        <td width="100" colspan="2">&nbsp;</td>
      </tr>
	    <tr bgcolor="#FAFAFA">
        <td width="800" align="center" valign="top">&nbsp;</td>
        <td colspan="2">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>

